/*
 * @Author: delin66
 * @Date: 2025-06-04 14:33:52
 * @LastEditors: delin66
 * @LastEditTime: 2025-06-04 16:22:01
 * @Descripttion: 
 */
import request from './request';

// 人才库接口类型定义
export interface TalentPerson {
  id?: number;
  name: string;
  avatar: string;
  category: number; // 人才类别 0 教师 1 专家
  field: string[]; // 领域
  ability: string[]; // 能力
  province: string; // 所在区
  city: string; // 市
  school: string; // 学校
  hiredate: string; // 聘任日期
  education: string; // 学历
  introduction: string; // 介绍
  createTime?: string;
  updateTime?: string;
}

// 查询参数类型
export interface TalentPersonQuery {
  current?: number;
  size?: number;
  name?: string;
  category?: number;
  field?: string;
  ability?: string;
  province?: string;
  city?: string;
  school?: string;
}

// 添加人才
export function addTalentPerson(data: TalentPerson) {
  return request({
    url: '/kjy/talentPerson',
    method: 'post',
    data
  });
}

// 修改人才
export function updateTalentPerson(data: TalentPerson) {
  return request({
    url: '/kjy/talentPerson',
    method: 'put',
    data
  });
}

// 获取人才列表
export function getTalentPersonList(params: TalentPersonQuery) {
  return request({
    url: '/kjy/talentPerson/list',
    method: 'get',
    params
  });
}

// 根据ID获取人才信息
export function getTalentPersonById(id: number) {
  return request({
    url: `/kjy/talentPerson/${id}`,
    method: 'get'
  });
}

// 根据ID删除人才
export function deleteTalentPerson(ids: string) {
  return request({
    url: `/kjy/talentPerson/${ids}`,
    method: 'delete'
  });
}
